
import 'dart:convert';
import 'package:ichinesereader/models/common/Settings.dart';

List<SchoolTeacher> schoolTeachersFromJson(String str) =>
    List<SchoolTeacher>.from(
        json.decode(str).map((x) => SchoolTeacher.fromJson(x)));

String schoolTeachersToJson(List<SchoolTeacher> data) =>
    json.encode(List<dynamic>.from(data.map((x) => x.toJson())));

class SchoolTeacher {
  SchoolTeacher({
    this.classId,
    this.className,
    this.classNames,
    this.disabled,
    this.email,
    this.firstName,
    this.lastLoggedIn,
    this.lastName,
    this.objectId,
    this.password,
    this.schoolAdmin,
    this.settings,
    this.status,
    this.totalAssignment,
    this.userName,
  });

  List<String>? classId;
  List<String>? className;
  String? classNames;
  bool? disabled;
  String? email;
  String? firstName;
  int? lastLoggedIn;
  String? lastName;
  String? objectId;
  String? password;
  String? schoolAdmin;
  Settings? settings;
  bool? status;
  int? totalAssignment;
  String? userName;

  factory SchoolTeacher.fromJson(Map<String, dynamic> json) => SchoolTeacher(
        classId: List<String>.from(json["classId"].map((x) => x)),
        className: List<String>.from(json["className"].map((x) => x)),
        classNames: json["classNames"],
        disabled: json["disabled"],
        email: json["email"],
        firstName: json["firstName"],
        lastLoggedIn: json["lastLoggedIn"],
        lastName: json["lastName"],
        objectId: json["objectId"],
        password: json["password"],
        schoolAdmin: json["schoolAdmin"],
        settings: Settings.fromJson(json["settings"]),
        status: json["status"],
        totalAssignment: json["totalAssignment"],
        userName: json["userName"],
      );

  Map<String, dynamic> toJson() => {
        "classId": List<dynamic>.from(classId!.map((x) => x)),
        "className": List<dynamic>.from(className!.map((x) => x)),
        "classNames": classNames,
        "disabled": disabled,
        "email": email,
        "firstName": firstName,
        "lastLoggedIn": lastLoggedIn,
        "lastName": lastName,
        "objectId": objectId,
        "password": password,
        "schoolAdmin": schoolAdmin,
        "settings": settings?.toJson(),
        "status": status,
        "totalAssignment": totalAssignment,
        "userName": userName,
      };
}
